<template>
  <div class="recordlist">
    <div class="award" v-if="typeClass == 1 && info">
      <div class="list" v-for="(item, index) in info" :key="index">
        <div class="left">{{ item.day }}</div>
        <div class="right">+{{ item.reward }}</div>
      </div>
      <div class="noneTxt" v-if="info.length <= 0">暂无记录</div>
    </div>
    <div class="liveness" v-if="typeClass == 2 || typeClass == 3">
      <div class="title" v-if="typeClass == 2">累计总贡献值：{{ count }}</div>
      <div class="title" v-if="typeClass == 3">累计贡献值：{{ count }}</div>
      <template v-if="info && info.data">
        <div class="list" v-for="(item, index) in info.data" :key="index">
          <div class="top">
            <div class="name">{{ item.source_name }}</div>
            <div class="num">{{ item.type == 1 ? "+" : "-" }}{{ item.change_value }}</div>
          </div>
          <div class="bottom" v-if="item.bag">
            <div class="name">{{ item.bag.name }}</div>
            <div class="time">{{ item.created_at }}</div>
          </div>
        </div>
      </template>
      <div class="noneTxt" v-if="info && info.data.length <= 0">暂无记录</div>
    </div>
    <div class="resurgence" v-if="typeClass == 4">
      <template v-if="info && info.data">
        <div class="list" v-for="(item, index) in info.data" :key="index">
          <div class="taskName" v-if="item.bag">{{ item.bag.name }}</div>
          <div class="time">{{ item.created_at }}</div>
          <div class="lis">
            <div class="left mbottom">复活时间：{{ item.day }}</div>
            <div class="right mbottom">支付方式：{{ item.pay_type }}</div>
          </div>
          <div class="lis">
            <div class="left">支付单号：{{ item.pay_sn }}</div>
            <div class="right">支付金额：{{ item.pay_amount }}</div>
          </div>
        </div>
      </template>
      <div class="noneTxt" v-if="info && info.data.length <= 0">暂无记录</div>
    </div>
    <div class="serviceCharge" v-if="typeClass == 5 || typeClass == 6">
      <div class="title">累计分红金额：{{ count }}</div>
      <template v-if="info && info.data">
        <div class="list" v-for="(item, index) in info.data" :key="index">
          <div class="timeTop">{{ item.created_at }}</div>
          <template v-if="typeClass == 5">
            <div class="lis">
              <div class="left mbottom">手续费总数：{{ item.total }}</div>
              <div class="right mbottom">等级人数：{{ item.people_num }}人</div>
            </div>
            <div class="lis">
              <div class="left">分红比例：{{ item.bonus_rate }}%</div>
              <div class="right">分红金额：{{ item.amount }}</div>
            </div>
          </template>
          <template v-if="typeClass == 6">
            <div class="lissix">
              <div class="left mbottom" v-if="show">分红总金额：{{ item.total }}</div>
              <div class="right mbottom">等级{{usable_name?usable_name:'可用爱心值'}}：{{ item.level_love_total }}</div>
              <div class="left">本人持有：{{ item.self_love }}</div>
              <div class="right">分红金额：{{ item.amount }}</div>
            </div>
          </template>
        </div>
      </template>
      <div class="noneTxt" v-if="info && info.data.length <= 0">暂无记录</div>
    </div>
    <div class="team" v-if="typeClass == 7">
      <div class="title">下级团队人数：{{ count }}</div>
      <template v-if="info && info.data">
        <div class="list" v-for="(item, index) in info.data" :key="index" >
          <div class="image">
            <img :src="item.avatar" alt="" />
          </div>
          <div class="user">
            <div class="top van-ellipsis">{{ item.nickname }}（id：{{ item.uid }}）</div>
            <div class="mobile van-ellipsis" v-if="item.mobile">{{ item.mobile }}</div>
          </div>
        </div>
      </template>
      <div class="noneTxt" v-if="info && info.data.length <= 0">暂无记录</div>
    </div>
    <div class="List" v-if="typeClass == 8">
      <template v-for="(item,index) in info">
        <div class="cloum taskLis_two" :key="index" @click="tapTask(item.id)">
          <div class="taskLis">
            <div class="taskLis_left"><img :src="item.pic" alt="" /></div>
            <div class="taskLis_right">
              <div class="taskLis_right-top">
                <div class="title">{{ item.name }}</div>
                <div class="loveTxt">{{ item.love_amount }}{{ usable_name }}</div>
              </div>
              <div class="taskLis_right-time">
                <div class="time">有效期 {{ item.active_start }}至 {{ item.active_end }}</div>
              </div>
              <div class="taskLis_right-count">
                <div class="countlis">收益率 {{ item.return_rate }}</div>
                <div class="countlis">总释放 {{ item.total_amount }}</div>
                <div class="countlis">日释放 {{ item.daily_amount }}</div>
              </div>
            </div>
          </div>
          <div class="schedule">
            <div class="line"></div>
            <div class="txt">
              任务:观看
              <span class="dcolor">{{ item.daily.video }}</span>
              个视频，分享<span class="dcolor">{{ item.daily.share }}</span
              >个视频，转发<span class="dcolor">{{ item.daily.article }}</span
              >篇文章
            </div>
          </div>
        </div>
      </template>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    typeClass: {
      type: String,
      default: null
    },
    info: {
      type: null
    },
    count: {
      type: null
    },
    show: {
      type: Boolean,
      default: false
    },
    usable_name:{
      type:String,
      default:''
    }
  },
  watch: {
    info(nval, oval) {
      if(this.typeClass == 8){
        // this.selected = this.info[0].list
        console.log(this.info[0].list)
      }
      console.log(nval, oval, "nval");
    }
  },
  data() {
    return {
      selected: {},
    };
  },
  methods:{
    tapTask(kid) {
      this.$router.push(this.fun.getUrl("taskPackageTask", { id: kid }));
    },
  },
  mounted() {}
};
</script>
<style lang="scss" scoped>
.noneTxt {
  text-align: center;
  color: #999;
}

.recordlist {
  padding-bottom: 3rem;
}

.resurgence {
  margin: 0.63rem;

  .list {
    background: #fff;
    border-radius: 0.31rem;
    padding: 0.78rem 0.81rem;
    box-sizing: border-box;
    margin-bottom: 0.63rem;

    .lis {
      display: flex;
      justify-content: flex-start;
      font-size: 0.69rem;
      line-height: 0.66rem;

      .left {
        width: 60%;
        text-align: left;
      }

      .right {
        flex: 1;
        text-align: left;
      }

      .mbottom {
        margin-bottom: 0.59rem;
      }
    }

    .taskName {
      font-size: 0.81rem;
      line-height: 0.75rem;
      margin-bottom: 0.59rem;
      text-align: left;
    }

    .time {
      font-size: 0.63rem;
      line-height: 0.5rem;
      text-align: left;
      color: #919191;
      margin-bottom: 0.9rem;
    }
  }
}

.team {
  margin: 0 0.63rem;

  .title {
    padding: 0.91rem 0.84rem;
    box-sizing: border-box;
    font-size: 0.88rem;
    color: #333;
    text-align: left;
  }

  .list {
    padding: 0.88rem;
    background: #fff;
    border-radius: 0.31rem;
    display: flex;
    margin-bottom: 0.63rem;

    .image {
      width: 1.88rem;
      height: 1.88rem;
      border-radius: 100%;
      margin-right: 0.56rem;

      img {
        width: 100%;
        height: 100%;
        border-radius: 100%;
      }
    }

    .user {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      overflow: hidden;

      .top {
        width: 100%;
        text-align: left;
        font-size: 0.75rem;
        line-height: 0.75rem;
      }

      .mobile {
        width: 100%;
        text-align: left;
        font-size: 0.63rem;
        color: #666;
        line-height: 0.63rem;
      }
    }
  }
}

.liveness,
.serviceCharge {
  margin: 0 0.63rem;

  .title {
    padding: 0.91rem 0.84rem;
    box-sizing: border-box;
    font-size: 0.88rem;
    color: #333;
    text-align: left;
  }

  .list {
    padding: 0.75rem 0.84rem;
    box-sizing: border-box;
    border-radius: 0.31rem;
    background: #fff;
    margin-bottom: 0.63rem;

    .lis {
      display: flex;
      justify-content: flex-start;
      font-size: 0.69rem;
      line-height: 0.66rem;

      .left {
        width: 50%;
        text-align: left;
      }

      .right {
        flex: 1;
        text-align: left;
      }

      .mbottom {
        margin-bottom: 0.59rem;
      }
    }

    .timeTop {
      font-size: 0.63rem;
      margin-bottom: 0.9rem;
      color: #919191;
      text-align: left;
    }

    .top,
    .bottom {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .top {
      margin-bottom: 0.81rem;
    }

    .top .name {
      font-size: 0.81rem;
      color: #333;
    }

    .top .num {
      font-size: 0.81rem;
      color: #f51d1d;
    }

    .bottom .name {
      color: #666;
      font-size: 0.69rem;
    }

    .bottom .time {
      font-size: 0.63rem;
      color: #919191;
    }
  }
}

.award {
  margin: 0.63rem;

  .list {
    padding: 0.94rem 0.84rem;
    background: #fff;
    border-radius: 0.31rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.63rem;
    border-radius: 0.31rem;

    .left {
      color: #000;
    }

    .right {
      font-size: 0.81rem;
      color: #f51d1d;
    }
  }
}

.lissix {
  display: flex;
  flex-wrap: wrap;
  text-align: left;
  font-size: 0.69rem;

  .mbottom {
    margin-bottom: 0.59rem;
  }

  .left {
    width: 50%;
  }

  .right {
    width: 50%;
  }
}

.List {
  margin: 0.63rem;
  padding-bottom: 4rem;

  .schedule {
    padding: 0 0.63rem;
    background: #fff;
    text-align: left;

    .line {
      width: 100%;
      height: 1.0016px;
      background: #dfdfdf;
    }

    .txt {
      padding: 0.75rem 0;
      box-sizing: border-box;
      font-size: 0.69rem;

      .dcolor {
        color: #f51d1d;
      }
    }
  }

  .taskLis_one {
    margin-bottom: 0.63rem;
  }

  .taskLis_two {
    margin-bottom: 0.63rem;
  }

  .taskLis {
    padding: 0.72rem 0.63rem;
    border-radius: 0.31rem;
    background: #fff;
    display: flex;
    align-items: center;
    border: 1px solid #fff;

    .taskLis_right {
      flex: 1;
      overflow: hidden;

      .taskLis_right-top {
        display: flex;
        justify-content: space-between;

        .title {
          flex: 1;
          font-size: 0.81rem;
          text-align: left;
          margin-right: 1.31rem;
          display: -webkit-box;
          -webkit-box-orient: vertical;
          -webkit-line-clamp: 2;
          overflow: hidden;
        }

        .loveTxt {
          flex-shrink: 0;
          color: #f51d1d;
          font-size: 0.69rem;
        }
      }

      .taskLis_right-time {
        font-size: 0.63rem;
        color: #807e7e;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin: 0.66rem 0 0.81rem 0;

        .totalCount {
          color: #66a3e7;
        }
      }

      .taskLis_right-count {
        display: flex;

        .countlis:last-child {
          margin-right: 0;
        }

        .countlis {
          font-size: 0.63rem;
          color: #4c4c4c;
          font-weight: 400;
          margin-right: 1.09rem;
        }
      }
    }

    .taskLis_left {
      flex-shrink: 0;
      width: 4.38rem;
      height: 4.38rem;
      background: #8b8b8b;
      border-radius: 0.19rem;
      margin-right: 0.59rem;
      overflow: hidden;

      img {
        width: 100%;
        height: 100%;
        margin: 0;
      }
    }
  }

  .taskLisSelect {
    border: 1.0016px solid #f51d1d;
  }
}

</style>